import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueDevTools from "vite-plugin-vue-devtools";
import postcssPluginPx2rem from "postcss-plugin-px2rem";

const px2remOptions = {
	rootValue: 192,
	unitPrecision: 5,
	mediaQuery: false,
	minPixelValue: 2
};
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue(), vueDevTools()],
	resolve: {
		alias: {
			"@": fileURLToPath(new URL("./src", import.meta.url))
		}
	},
	css: {
		postcss: {
			plugins: [postcssPluginPx2rem(px2remOptions)]
		}
	}
});
